const vFilter = {
	formatDate(time){
    	var dataStr;
	 	var d = new Date(time);
		var hours=d.getHours();
		if(parseInt(hours)<10){
			hours="0"+hours;
		}
		var minutes=d.getMinutes();
		if(parseInt(minutes)<10){
			minutes="0"+minutes;
		}
		var seconds=d.getSeconds();
		if(parseInt(seconds)<10){
			seconds="0"+seconds;
		}
		var getDate=d.getDate();
		if(parseInt(getDate)<10){
			getDate="0"+getDate;
		}
		var getMonth=d.getMonth()+1;
		if(parseInt(getMonth)<10){
			getMonth="0"+getMonth;
		}
	 	dataStr = d.getFullYear()+'-'+getMonth+'-'+getDate+' ' +hours+':'+minutes+':'+seconds+'';
		return dataStr;
    },
    tranEmpty(data){
    	if(data == undefined || data === null || data === ""){
    		return "- -"
    	}else{
    		return data;
    	}
    },
    toFixed2(data){
    	const num = Number(data);
    	if(typeof num == 'number' && !isNaN(num)){
    		return data.toFixed(2);
    	}else{
    		return '';
    	}
    }
}
export default vFilter